package com.eii.resubmit.aop.request.annotation;

import org.springframework.core.annotation.AnnotationUtils;

import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
import java.lang.annotation.Target;
import java.lang.reflect.Method;

/**
 * 基于Redis实现 控制重复请求注解,只用于controller中的端点
 *
 * @author eii
 * @time 2020/11/29 3:49 下午
 */
@Target({ ElementType.METHOD, ElementType.TYPE })
@Retention(RetentionPolicy.RUNTIME)
public @interface RepeatRedisLock {

    public static class RepeatRedisLockHelper {
        public static RepeatRedisLock get(Method method, Class<?> targetClass) {
            RepeatRedisLock annotation = AnnotationUtils.findAnnotation(method, RepeatRedisLock.class);
            return annotation;
        }
    }

}
